crash on self-linkset creation

Hi,
i wrote a function that for each formal module inside a project create a self linkset for the module (source=target).
This function is included in a bigger script that create the whole structure (projects, folder, module) of a project according to a configuration module. But sometimes in undeterminist way i get some crash in the create linkset instruction or when i try to save the link module. Can someone help me to find any mistakes, or any further control i can make before creating a linkset?
void CreateAutolink (Folder f,Module &lm) {
Item itm
string s_lm_prop=fullName lm

bool b_canCreateLink
if (null lm) {
printDebugInfo(s_lm_prop " non esiste\n", s_INFO,s_DebugINFO)
return
}
Folder f_child
for itm in f do {
if ((type(itm)=="Folder") ||(type(itm)=="Project")){
f_child=folder(fullName(itm))
CreateAutolink (f_child, lm)
}else if (type(itm)=="Formal") {
b_canCreateLink=false
if (canModify(lm)) {
b_canCreateLink=true
} else {
// se non posso modificare lm provo a chiuderlo e riaprirlo
lm=edit(s_lm_prop)
}
if (b_canCreateLink) {
//////CRASH HERE
create (lm,fullName(itm),fullName(itm))
addLinkModuleDescriptor(folder(path(itm)),fullName(itm),fullName(itm), false, s_lm_prop,"" )
printDebugInfo (name(itm) " autolink creation: OK\n", s_INFO,s_DebugINFO)
} else {
printDebugInfo (name(itm) " autolink creation: NOT OK (cannot modify " name lm ")\n", s_ERROR,s_DebugINFO)

}
}
}
}

Folder fcurr=current
Module lm_prop=edit("LINK MODULE FULL NAME",false)
CreateAutolink (fcurr,lm_prop)
//CRASH HERE
save lm_prop
close lm_prop
SystemAdmin - Thu Feb 28 03:50:38 EST 2013

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 07:11:39 EST 2013

Hi

Sorry for saying this.
a) It is something easier to read the code if you use the tags of this forum-software.
b) It is something easier to help you if we know the content of the error message you have had. Sometimes the content of an error message makes some sense.

Best regards
Wolfgang

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 08:23:40 EST 2013

SystemAdmin - Thu Feb 28 07:11:39 EST 2013
Hi

Sorry for saying this.
a) It is something easier to read the code if you use the tags of this forum-software.
b) It is something easier to help you if we know the content of the error message you have had. Sometimes the content of an error message makes some sense.

Best regards
Wolfgang

i am sorry, you are right! But i don't have the log of the error right now.
About the tags i didn't notice the code ones.
 

void CreateAutolink (Folder f,Module &lm) {
Item itm
string s_lm_prop=fullName lm
 
bool b_canCreateLink
if (null lm) {
printDebugInfo(s_lm_prop " non esiste\n", s_INFO,s_DebugINFO)
return
}
Folder f_child
for itm in f do {
if ((type(itm)=="Folder") ||(type(itm)=="Project")){
f_child=folder(fullName(itm))
CreateAutolink (f_child, lm)
}else if (type(itm)=="Formal") {
b_canCreateLink=false
if (canModify(lm)) {
b_canCreateLink=true
} else {
// se non posso modificare lm provo a chiuderlo e riaprirlo
lm=edit(s_lm_prop)
}
if (b_canCreateLink) {
//////CRASH HERE
create (lm,fullName(itm),fullName(itm))
addLinkModuleDescriptor(folder(path(itm)),fullName(itm),fullName(itm), false, s_lm_prop,"" )
printDebugInfo (name(itm) " autolink creation: OK\n", s_INFO,s_DebugINFO)
} else {
printDebugInfo (name(itm) " autolink creation: NOT OK (cannot modify " name lm ")\n", s_ERROR,s_DebugINFO)
 
}
}
}
}
 
Folder fcurr=current
Module lm_prop=edit("LINK MODULE FULL NAME",false)
CreateAutolink (fcurr,lm_prop)
//CRASH HERE
save lm_prop
close lm_prop

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 08:46:06 EST 2013

SystemAdmin - Thu Feb 28 08:23:40 EST 2013

i am sorry, you are right! But i don't have the log of the error right now.
About the tags i didn't notice the code ones.
 

void CreateAutolink (Folder f,Module &lm) {
Item itm
string s_lm_prop=fullName lm
 
bool b_canCreateLink
if (null lm) {
printDebugInfo(s_lm_prop " non esiste\n", s_INFO,s_DebugINFO)
return
}
Folder f_child
for itm in f do {
if ((type(itm)=="Folder") ||(type(itm)=="Project")){
f_child=folder(fullName(itm))
CreateAutolink (f_child, lm)
}else if (type(itm)=="Formal") {
b_canCreateLink=false
if (canModify(lm)) {
b_canCreateLink=true
} else {
// se non posso modificare lm provo a chiuderlo e riaprirlo
lm=edit(s_lm_prop)
}
if (b_canCreateLink) {
//////CRASH HERE
create (lm,fullName(itm),fullName(itm))
addLinkModuleDescriptor(folder(path(itm)),fullName(itm),fullName(itm), false, s_lm_prop,"" )
printDebugInfo (name(itm) " autolink creation: OK\n", s_INFO,s_DebugINFO)
} else {
printDebugInfo (name(itm) " autolink creation: NOT OK (cannot modify " name lm ")\n", s_ERROR,s_DebugINFO)
 
}
}
}
}
 
Folder fcurr=current
Module lm_prop=edit("LINK MODULE FULL NAME",false)
CreateAutolink (fcurr,lm_prop)
//CRASH HERE
save lm_prop
close lm_prop

> But i don't have the log of the error right now.

Then the answer is 47.

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 08:49:10 EST 2013

SystemAdmin - Thu Feb 28 08:46:06 EST 2013
> But i don't have the log of the error right now.

Then the answer is 47.

Did you mean to say 42 ? (Thanks for the fish!)

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 08:55:23 EST 2013

SystemAdmin - Thu Feb 28 08:49:10 EST 2013
Did you mean to say 42 ? (Thanks for the fish!)

i was able to recover two screenshot, even if sometimes the error is defferent something about memory exceed
Attachments

attachment_14946300_untitled.jpg

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 08:55:55 EST 2013

SystemAdmin - Thu Feb 28 08:55:23 EST 2013
i was able to recover two screenshot, even if sometimes the error is defferent something about memory exceed

..
Attachments

attachment_14946301_untitled.jpg

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 08:56:00 EST 2013

SystemAdmin - Thu Feb 28 08:55:55 EST 2013
..

sorry i sent twice the same screenshot
Attachments

attachment_14946302_untitled1.jpg

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 09:21:13 EST 2013

SystemAdmin - Thu Feb 28 08:56:00 EST 2013
sorry i sent twice the same screenshot

Hi

I do not understand this problem. I get a large list of errors if I start your code.
 

[progress] Executing /Werkstattt/x.dxl
-E- DXL: <Line:14> incorrectly concatenated tokens
Included from:
    <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:14> undeclared variable (s_DebugINFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:14> undeclared variable (s_INFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:14> undeclared variable (printDebugInfo)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> incorrectly concatenated tokens
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> undeclared variable (s_DebugINFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> undeclared variable (s_INFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> undeclared variable (printDebugInfo)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:36> incorrectly concatenated tokens
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:36> undeclared variable (s_DebugINFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
  too many messages -- suspending error reporting-I- DXL: All done. Errors reported: 12. Warnings reported: 0.
[progress] Done.

 


Best regards
Wolfgang

 

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 10:11:28 EST 2013

SystemAdmin - Thu Feb 28 09:21:13 EST 2013

Hi

I do not understand this problem. I get a large list of errors if I start your code.
 

[progress] Executing /Werkstattt/x.dxl
-E- DXL: <Line:14> incorrectly concatenated tokens
Included from:
    <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:14> undeclared variable (s_DebugINFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:14> undeclared variable (s_INFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:14> undeclared variable (printDebugInfo)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> incorrectly concatenated tokens
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> undeclared variable (s_DebugINFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> undeclared variable (s_INFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:34> undeclared variable (printDebugInfo)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:36> incorrectly concatenated tokens
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
-E- DXL: <Line:36> undeclared variable (s_DebugINFO)
Included from:
        <c:\temp\DXLEditor\launcher_7951266244160592450.dxl:14> 
        <Line:1> 
  too many messages -- suspending error reporting-I- DXL: All done. Errors reported: 12. Warnings reported: 0.
[progress] Done.

 


Best regards
Wolfgang

 

delete the code lines with the instruction printDebugInfo

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 10:25:20 EST 2013

SystemAdmin - Thu Feb 28 10:11:28 EST 2013
delete the code lines with the instruction printDebugInfo

Believe me the code does not crash.
 

[progress] Executing /Werkstattt/x.dxl
-R-E- DXL: <Line:11> null Module parameter was passed into argument position 1
Backtrace:
    <Line:41> 
-I- DXL: execution halted
[progress] Done.

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 10:25:45 EST 2013

SystemAdmin - Thu Feb 28 10:11:28 EST 2013
delete the code lines with the instruction printDebugInfo

Believe me the code does not crash.
 

[progress] Executing /Werkstattt/x.dxl
-R-E- DXL: <Line:11> null Module parameter was passed into argument position 1
Backtrace:
    <Line:41> 
-I- DXL: execution halted
[progress] Done.

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 10:41:27 EST 2013

SystemAdmin - Thu Feb 28 10:25:45 EST 2013

Believe me the code does not crash.
 

[progress] Executing /Werkstattt/x.dxl
-R-E- DXL: <Line:11> null Module parameter was passed into argument position 1
Backtrace:
    <Line:41> 
-I- DXL: execution halted
[progress] Done.

the code crash "sometimes"
As i told you this code is an extract of a bigger code. I want to ask, is there any further control on the link module before creating a linkset?
Is there any circumstance that i can't create a self-linkset?

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 10:45:02 EST 2013

SystemAdmin - Thu Feb 28 10:41:27 EST 2013
the code crash "sometimes"
As i told you this code is an extract of a bigger code. I want to ask, is there any further control on the link module before creating a linkset?
Is there any circumstance that i can't create a self-linkset?

> the code crash "sometimes"

Because the part you have posted is not complete. There is a "null"

> I want to ask, is there any further control on the link module before creating a linkset?

Avoid a null or - if it is not a null but an arbitrary value - avoid arbitrary input in your data.

Re: crash on self-linkset creation
llandale - Thu Feb 28 11:03:08 EST 2013

SystemAdmin - Thu Feb 28 08:23:40 EST 2013

i am sorry, you are right! But i don't have the log of the error right now.
About the tags i didn't notice the code ones.
 

void CreateAutolink (Folder f,Module &lm) {
Item itm
string s_lm_prop=fullName lm
 
bool b_canCreateLink
if (null lm) {
printDebugInfo(s_lm_prop " non esiste\n", s_INFO,s_DebugINFO)
return
}
Folder f_child
for itm in f do {
if ((type(itm)=="Folder") ||(type(itm)=="Project")){
f_child=folder(fullName(itm))
CreateAutolink (f_child, lm)
}else if (type(itm)=="Formal") {
b_canCreateLink=false
if (canModify(lm)) {
b_canCreateLink=true
} else {
// se non posso modificare lm provo a chiuderlo e riaprirlo
lm=edit(s_lm_prop)
}
if (b_canCreateLink) {
//////CRASH HERE
create (lm,fullName(itm),fullName(itm))
addLinkModuleDescriptor(folder(path(itm)),fullName(itm),fullName(itm), false, s_lm_prop,"" )
printDebugInfo (name(itm) " autolink creation: OK\n", s_INFO,s_DebugINFO)
} else {
printDebugInfo (name(itm) " autolink creation: NOT OK (cannot modify " name lm ")\n", s_ERROR,s_DebugINFO)
 
}
}
}
}
 
Folder fcurr=current
Module lm_prop=edit("LINK MODULE FULL NAME",false)
CreateAutolink (fcurr,lm_prop)
//CRASH HERE
save lm_prop
close lm_prop

I'm pretty sure you want a bunch of LinkSets and LinkSetDescriptors created all in a SINGLE project-wide link module.

I've seen some wierd things when you both READ and MODIFY an input parameter. I think this is your problem. You can check "canModify" before you get to your function, remove the "&" from "&lm", and do NOT re-Edit the linkmodule.

You want "canCreate" not "canModify".

I'm paranoid and OCD. Try to set the current folder before messing around with this stuff.
  • current = f
  • create(...

-Louie

Re: crash on self-linkset creation
SystemAdmin - Thu Feb 28 11:05:13 EST 2013

SystemAdmin - Thu Feb 28 10:45:02 EST 2013
> the code crash "sometimes"

Because the part you have posted is not complete. There is a "null"

> I want to ask, is there any further control on the link module before creating a linkset?

Avoid a null or - if it is not a null but an arbitrary value - avoid arbitrary input in your data.

for running the code you need to create a Link Module and write the full name in this instruction
 

Module lm_prop=edit("LINK MODULE FULL NAME",false)